home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Internet / WWW / swish.11 / src / mem.c < prev    next >
C/C++ Source or Header  |  1995-03-11  |  632b  |  34 lines

  1. /*
  2. ** Copyright (C) 1995, Enterprise Integration Technologies Corp.        
  3. ** All Rights Reserved.
  4. ** Kevin Hughes, kevinh@eit.com 
  5. ** 3/11/94
  6. */
  7.  
  8. #include "swish.h"
  9. #include "mem.h"
  10.  
  11. /* Error-checking malloc()...
  12. */
  13.  
  14. void *emalloc(i)
  15.      int i;
  16. {
  17.         void *p;
  18.  
  19.         if ((p = (void *) malloc(i)) == NULL)
  20.                 progerr("Ran out of memory (could not allocate enough)!");
  21.         return p;
  22. }
  23.  
  24. void *erealloc(ptr, i)
  25.      void *ptr;
  26.      int i;
  27. {
  28.         void *p;
  29.  
  30.         if ((p = (void *) realloc(ptr, i)) == NULL)
  31.                 progerr("Ran out of memory (could not reallocate enough)!");
  32.         return p;
  33. }
  34.